//动态加载iframe Src
/**
 * @param mapDiv:GIS地图所在DIV对象
 * @param pathName:加载页面名称(gis/default/webmap/后面的html):
 * 	baseMapIdentification.html     图层序号[1] 地面标识    //没有数据，暂时没有测试
	baseMapPiggingstructure.html   图层序号[2] 收发球筒    
	baseMapPiggingstructure.html   图层序号[3] 埋地标识
	baseMapGww.html 			   图层序号[4] 环焊缝
	baseMapClosure.html 		   图层序号[5] 封堵物
	baseMapCelbow-Elbow.html       图层序号[6]  冷弯
								   图层序号[7]  热煨弯头
	baseMapReducer.html			   图层序号[8]  异管径
	baseMapTap.html			       图层序号[9]  开孔

	baseMapVavle.html    		   图层序号[11] 阀门
 */
function initGis(mapDiv, pathName){
	console.log(pathName)
    var html='<iframe id="dyMap" style="visibility: visible; width: 98%; border-color: rgb(47, 128, 190);" src='+pathName+'></iframe>'
    mapDiv.html(html);
}

//GIS页面
/**
 * @param gisIdJsonArray:GISID相关JSON数组,例如:[{"typeName":"冷弯","gisIdArray":['47ff7ad367864df6a29cebbf184057c7','a9a3f76c21164767b26884fb8206e21f']},
{"typeName":"热煨弯头","gisIdArray":['8d7a7f4a840b4adc9a24deaff4005809','61f35a5a9933464d913e6dbca85169f3','accf67972e7f4d7fb1d821f50e3ed4fd'
]}]
 * @param CloseToolbar:是否关闭动作条--布尔值(true:关闭,flase:显示)
 */
function loadGis_bak(gisIdJsonArray,CloseToolbar){
	
	var dyPipe= document.getElementById("dyMap").contentWindow.basePipeLine;
	var dyMap = document.getElementById("dyMap").contentWindow.basePipeMap;
	
	console.log(gisIdJsonArray);
	dyPipe.queryFromMutiLayers(gisIdJsonArray,dyMap.currentMap);
	
	
	if(true==CloseToolbar){
		dyMap.hideToolBar();
	}else if(false ==CloseToolbar){
		dyMap.showToolBar();
	}
}

function loadGis(mapDiv, url, gisIdJsonArray){

	mapDiv.html('<iframe id="dyMap" style="visibility: visible; width: 100%; border-color: rgb(47, 128, 190); height: 450px;"></iframe>');

	var formObj = document.createElement("form");
	formObj.setAttribute("method", "post");
	formObj.setAttribute("action", url);

	var inputObj = document.createElement("input");
	inputObj.setAttribute("type", "hidden");
	inputObj.setAttribute("name", "gisJsonArr");
	var valueStr = "";
	if (JSON) {
		valueStr = JSON.stringify(gisIdJsonArray);
	}
	inputObj.setAttribute("value", valueStr);

	formObj.appendChild(inputObj);
	// 可以继续放到div中
	document.getElementById('dyMap').contentWindow.document
			.write(formObj.outerHTML);
	document.getElementById('dyMap').contentWindow.document
			.getElementsByTagName("form")[0].submit();
}

